package day8;

import java.util.Scanner;

/**
 * 题目链接
 * https://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3?tpId=37&&tqId=21331&rp=1&ru=/activity/oj&qru=/ta/huawei/question-ranking
 */
public class TestDemo13 {
    public static int func(int a,int b) {
        int max = a >= b ? a:b;
        int min = a >= b ? b:a;
        if(max > min) {
            int x = max-min;
            max = x >= min ? x:min;
            min = x >= min ? min:x;
        }
        if(max == min) {
            return max;
        }
        return func(max,min);
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        System.out.println((a * b) / func(a, b));
        System.out.println(func(a, b));
    }
}
